package com.zx.zxojbackendquestion.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zx.zxojbackendmodel.dto.questionSubmit.QuestionSubmitAddRequest;
import com.zx.zxojbackendmodel.entity.QuestionSubmit;
import com.zx.zxojbackendmodel.entity.User;
import com.zx.zxojbackendmodel.vo.QuestionSubmitVO;


import javax.servlet.http.HttpServletRequest;

/**
* @author ZX
* @description 针对表【question_submit(题目提交)】的数据库操作Service
* @createDate 2025-02-04 21:46:29
*/
public interface QuestionSubmitService extends IService<QuestionSubmit> {

    /**
     * 提交题目
     * @param questionSubmitAddRequest
     * @param loginUser
     * @return 返回提交题目的id
     */
    Long doQuestionSubmit(QuestionSubmitAddRequest questionSubmitAddRequest, User loginUser);

    /**
     * 构造查询条件
     *
     * @param questionSubmitAddRequest
     * @return
     */
    QueryWrapper<QuestionSubmit> getQueryWrapper(QuestionSubmitAddRequest questionSubmitAddRequest,User loginUser);

    /**
     * 获取题目封装
     *
     * @param questionSubmit
     * @param request
     * @return
     */
    QuestionSubmitVO getQuestionSubmitVO(QuestionSubmit questionSubmit, User loginUser, HttpServletRequest request);

    /**
     * 分页获取题目封装
     *
     * @param questionSubmitPage
     * @param request
     * @return
     */
    Page<QuestionSubmitVO> getQuestionSubmitVOPage(Page<QuestionSubmit> questionSubmitPage, User loginUser,HttpServletRequest request);
}
